<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    .s{
      position: relative;
      padding: 20px;
    }
    .s input{
      display: none;
    }
    .s1{
      width: 100px;
      height: 40px;
      background: #ccc;
      display: block;
      overflow: hidden;
      cursor: pointer;
      transition: .4s;
    }
    .s1::before{
      content: "";
      position: absolute;
      width: 32px;
      height: 32px;
      left: 4px;
      bottom: 4px;
      background: white;
    }
    .s input:checked + .s1{
      background: #03a9f4;
    }
    .s input:checked + .s1:before{
      left: 64px;
    }

    .s2{
      width: 100px;
      height: 40px;
      background: #ccc;
      display: block;
      overflow: hidden;
      cursor: pointer;
      transition: .4s;
      border-radius: 20px;
    }
    .s2::before{
      content: "";
      position: absolute;
      width: 32px;
      height: 32px;
      left: 4px;
      bottom: 4px;
      background: white;
      border-radius: 50%;
    }
    .s input:checked + .s2{
      background: #03a9f4;
    }
    .s input:checked + .s2:before{
      left: 64px;
    }
  </style>
</head>

<body>
  <label class="s">
    <input type="checkbox">
    <span class="s1"></span>
  </label>
  <label class="s">
    <input type="checkbox">
    <span class="s2"></span>
  </label>
</body>

</html>